package com.caojing.haolemai.ui.search;

import com.caojing.haolemai.bean.SearchHintBean;
import com.caojing.haolemai.httputils.HttpUtils;

/**
 * Created by CaoJing on 2016/10/19.
 */
public class SerachPresenter implements SearchContract.Presenter {
    private SearchContract.Model model;
    private SearchContract.View view;

    public SerachPresenter(SearchContract.View view) {
        this.view = view;
        this.model = new SearchModel();
    }

    @Override
    public void initData() {
        model.getSerachHintBean(new HttpUtils.HttpCallBack<SearchHintBean>() {
            @Override
            public void onSucess(SearchHintBean searchHintBean) {
                view.onSuccessGetHint(searchHintBean);
            }
            @Override
            public void onFail() {
                view.onFailGetHint("SearchHintBean检查网络");
            }
        });
    }
}
